﻿<UserControl x:Class="CrazyClient.ViewerControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
              xmlns:c="clr-namespace:CrazyClient"
       >
            
    <UserControl.Resources>
        <Style x:Key="baseStyle" TargetType="{x:Type TextBlock}">
            <Setter Property="FontFamily" Value="Trebuchet" />
            <Setter Property="FontSize" Value="0.15" />
            <Setter Property="FontWeight" Value="Bold" />
        </Style>
        <Style x:Key="otherStyle" TargetType="{x:Type TextBlock}">
            <Setter Property="FontFamily" Value="Times New Roman" />
            <Setter Property="FontSize" Value="0.2" />
           
        </Style>
        <Style x:Key="whiteStyle" TargetType="{x:Type TextBlock}">
            <Setter Property="FontFamily" Value="Trebuchet" />
            <Setter Property="FontSize" Value="0.2" />
            <Setter Property="Foreground" Value="White" />
        </Style>

        <MeshGeometry3D x:Key="xmlData" 
                Positions="-1 -1 0  1 -1 0  -1 1 0  1 1 0"
                Normals="0 0 1  0 0 1  0 0 1  0 0 1"
                TextureCoordinates="0 1  1 1  0 0  1 0   "
                TriangleIndices="0 1 2  1 3 2" />

        <!--<Storyboard x:Key="fadeIn" Name="fadeIn">
            <DoubleAnimation To="1" Duration="0:0:5">
            </DoubleAnimation>
        </Storyboard>-->
        <Storyboard x:Key="zoomIn" Name="zoomIn">
            <DoubleAnimation From="3" To="0" Duration="0:0:5">
            </DoubleAnimation>
        </Storyboard>
        <Storyboard x:Key="zoomOut" Name="zoomOut">
            <DoubleAnimation From="0" To="3" Duration="0:0:5">
            </DoubleAnimation>
        </Storyboard>
        <Storyboard x:Key="fadeOut" Name="fadeOut">
            <DoubleAnimation To="0" Duration="0:0:5">
            </DoubleAnimation>
        </Storyboard>


        <Storyboard x:Key="rotateIn" Name="rotateIn">
            <DoubleAnimation From="0" To="90" Duration="0:0:1">

            </DoubleAnimation>
        </Storyboard>
    </UserControl.Resources>
    <Grid ClipToBounds="False"   Name="MainGrid" ShowGridLines="True">
     
        <Viewport3D Grid.Row="0" Name="Viewport3D" >
            <Viewport3D.Camera>
                <!--c:CameraShaker.Shake="True"-->
                <PerspectiveCamera  x:Name="cam" Position="0,0,2.5" LookDirection="0,0,-8" 
                           UpDirection="0,1,0" FieldOfView="45" 
                            />
            </Viewport3D.Camera>

            <ModelVisual3D x:Name="xamlContent">
               
            </ModelVisual3D>

        </Viewport3D>
        <Grid x:Name="FlatPanel" Margin="0 0 0 0" HorizontalAlignment="Stretch" Width="Auto" Height="Auto"></Grid>
        <Rectangle x:Name="SongOverrider" Fill="Red">
            <Rectangle.Style>
                <Style>
                    <Style.Triggers>
               
                        <DataTrigger Binding="{Binding Path=Data.SongOverride}" Value="1">
                            <Setter Property="Rectangle.Opacity"  Value="{Binding ElementName=SongOverrider,Path=Opacity}"/>
                            <DataTrigger.EnterActions>
                                <BeginStoryboard Name="songOverrideOut">
                                    <Storyboard x:Name="songOverrideStoryboardFadeOut">
                                        <DoubleAnimation
                                            Storyboard.TargetProperty="Opacity"
                                            To="0.0"  Duration="0:0:5" 
                                        />
                                    </Storyboard>
                                </BeginStoryboard>
                                <StopStoryboard BeginStoryboardName="songOverrideIn" />
                            </DataTrigger.EnterActions>
                        </DataTrigger>

                        <DataTrigger Binding="{Binding Path=Data.SongOverride}" Value="0">
                          
                            <DataTrigger.EnterActions>
                                <BeginStoryboard Name="songOverrideIn">
                                    <Storyboard x:Name="songOverrideStoryboardFadeIn">
                                        <DoubleAnimation
                                            Storyboard.TargetProperty="Opacity"
                                            To="1.0" Duration="0:0:5" 
                                        />
                                    </Storyboard>
                                </BeginStoryboard>
                                <StopStoryboard BeginStoryboardName="songOverrideOut" />
                            </DataTrigger.EnterActions>
                        </DataTrigger>
                        
                    </Style.Triggers>
                    
                    </Style>
                </Rectangle.Style>
        </Rectangle>
    </Grid>
    
</UserControl>
